//
//  WBHomeViewController.swift
//  ZXYWeiBo
//
//  Created by haixuanyijing on 2017/8/13.
//  Copyright © 2017年 zxy. All rights reserved.
//

import UIKit

private let cellID = "cellID"


class WBHomeViewController: WBBaseViewController {

   lazy var statusList = [String]()
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
//        loadData()
        

        print("分支测试C啛啛喳喳错错错错")
        
     

    }

    func showFriends()  {


        let vc = WBDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
        
    }
    
    //giechongtu
    override func loadData() {
       
        print("分支测试2")

        for i in 1...20 {
            statusList.insert(i.description, at: 0)
        }
        
    }

}


extension WBHomeViewController{

    //重写父类方法
    override func setupUI() {
        super.setupUI()
        
//        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "好友", style: .plain, target: self, action: #selector(showFriends))
        
        
//        let btn : UIButton = UIButton.cz_textButton("好友", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
//        btn.addTarget(self, action: #selector(showFriends), for: .touchUpInside)
//        navigationItem.leftBarButtonItem = UIBarButtonItem(customView: btn)
        
        navItem.leftBarButtonItem = UIBarButtonItem(title: "好友", fontSize: 16, target: self, action: #selector(showFriends))
        
        
        tableView?.register(UITableViewCell.self, forCellReuseIdentifier: cellID)
        
    }
}


extension WBHomeViewController{
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return statusList.count
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: cellID, for: indexPath)
        
        cell.textLabel?.text = statusList[indexPath.row]
        
        return cell
    }
    
    override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 44
    }

}





